window.onresize=function width1(){
	var w =document.documentElement.clientWidth||document.body.clientWidth;
	var a=w+"px";
	/*alert("a:"+a);*/
	document.getElementById("bod").style.width=a;
	}

/*鼠标移入文本区时候显示阴影,事件委托*/

function a(){
	$("#articleUl").on("mouseover","li",function(){$(this).addClass("yinying")})/*jq中on()的事件委托机制*/
	$("#articleUl").on("mouseleave","li",function(){$(this).removeClass("yinying")})
	}

/*最新文章处的自动滚动效果*/
function wenBen(){	
var area=document.getElementById("scroll_area");
var con1=document.getElementById("con1");
var con2=document.getElementById("con2");
con2.innerHTML=con1.innerHTML;
function scrollUp(){
	if(area.scrollTop>=con1.offsetHeight){area.scrollTop=0;}
	else{area.scrollTop++;}
	}
var time=50;
var myScroll=setInterval("scrollUp()",time);	
area.onmouseover=function(){
	clearInterval(myScroll);
	}
area.onmouseout=function(){
	myScroll=setInterval("scrollUp()",time);
	}
}

/*完美运动框架*/
/*首先是青鸟中的诗句*/
var pMove=document.getElementById("topPhoto");
	var pmt=pMove.getElementsByTagName("p");
	for(var i=0;i<pmt.length;i++){
					setTimeout((function(i){return function(){startMove(pmt[i],{"left":100,"opacity":1})}})(i),i*1000);
					/*alert(i*1000);*/
					/*闭包*/
		} 
/*运动框架*/
	function getStyle(obj,attr){
		if(obj.currentStyle){return obj.currentStyle[attr];}/*ie浏览器下取属性值*/
		else{return getComputedStyle(obj,false)[attr];}/*火狐和chorom浏览器下取属性值*/
		}
	function startMove(obj,js){
		clearInterval(obj.timer);/*同时多个物体运动时，切记不要使用公共的变量,在发生事件时先清空之前的计时器*/
		obj.timer=setInterval(function(){
		for(attr in js){		/*使用js字面量方法，结合for-in循环，完成不同属性下的变化，如长和宽的同时变化*/
			var muBiao=0;
			if(attr=="opacity")
				{ muBiao=Math.round(parseFloat(getStyle(obj,attr))*100)
				}/*Mathround将不精确的尾巴去掉*/
			  else
			  	{ muBiao=parseInt(getStyle(obj,attr));/*目前元素的属性值*/}
			var speed =0
			if(attr=="opacity")
				{speed=(js[attr]*100-muBiao)/30;}
			  else
				{speed=(js[attr]-muBiao)/30;}
			speed=speed>0?Math.ceil(speed):Math.floor(speed);/*计算速度*/
			//检测停止
			if(muBiao==js[attr]){
				clearInterval(obj.timer)}
			else{
				if(attr=="opacity"){
							obj.style.filter="alpha(opacity:"+(muBiao+speed)+")";/*判断是否属性为透明度*/
							obj.style.opacity=(muBiao+speed)/100;
									}
				else{
							obj.style[attr]=muBiao+speed+"px";
					}
				}
		}},50)
		}
	
/*get请求*/
/*function get(){
$(document).ready(function(){ 
		$.ajax({ 
		    type: "GET", 	
			url: "http://localhost/ajaxDemo/web/php/liuyanban.php?number=1",
			dataType: "json",
			success: function(data) {
				if (data.success) { 
					$("#numName").html(data.num[0].name)
					$("#numTime").html(data.num[1].time)
					$("#numText").html(data.num[2].text)
					$("#num1Name").html(data.num1[0].name1)
					$("#num1Time").html(data.num1[1].time1)
					$("#num1Text").html(data.num1[2].text1)
					$("#num2Name").html(data.num2[0].name2)
					$("#num2Time").html(data.num2[1].time2)
					$("#num2Text").html(data.num2[2].text2)
				} else {
					alert("nihao");
				}  
			},
			error: function(jqXHR){     
			   alert("发生错误：" + jqXHR.status);  
			},     
		});
	});
}*/

	
	



